#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Niklas Hauser
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------


def init(module):
    module.name = ":driver:bmp085"
    module.description = """\
# BMP085 Pressure Sensor

The BMP085 is a high precision digital pressure sensor with I2C interface.
Unfortunately this sensor is so sensitive, it will give you wrong results
when there is traffic on the I2C during either temperature or pressure
conversion. So during that time make sure no other sensors on the bus
are read out.

For further information, consult the [product homepage][].
Also compatible to and tested with BMP180.

[product homepage]: https://www.bosch-sensortec.com/bst/products/all_products/bmp180
"""

def prepare(module, options):
    module.depends(
        ":architecture:i2c.device",
        ":math:utils",
        ":debug",
        ":processing:timer")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/driver/pressure"
    env.copy("bmp085.hpp")
    env.copy("bmp085_impl.hpp")
    env.copy("bmp085_data.hpp")
    env.copy("bmp085_data_impl_fp.hpp")
    if env[":target"].identifier["platform"] != "avr":
        env.copy("bmp085_data_impl_double.hpp")
